package com.qf10;

import java.util.concurrent.CopyOnWriteArraySet;

public class Demo3 {
    public static void main(String[] args) {
        //1.创建集合
        CopyOnWriteArraySet<String> set=new CopyOnWriteArraySet<>();
        set.add("pingguo");
        set.add("huawei");
        set.add("xiaomi");
        set.add("lianxiang");
        set.add("pingguo");
        //3.打印
        System.out.println("元素个数:"+set.size());
        System.out.println(set.toString());
    }
}
